<?php
/**
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 *
 */
if(isset($records['messageType'])) {
if ($records['messageType'] == 'SUCCESS') {
	$records['message'] = $lang_Time_AttendanceConfigSaving_SUCCESS;
} elseif ($records['messageType'] == 'FAILURE') {
	$records['message'] = $lang_Time_AttendanceConfigSaving_FAILURE;
} else {
	$records['message'] = null;
}
} else {
	$records['message'] = null;
}
?>

<div class="formpage">
    <div class="outerbox">
        <div class="mainHeading"><h2>考勤规则</h2></div>
        <?php if (isset($records['message'])) { ?>
            <div class="messagebar">
                <span class="<?php echo $records['messageType']; ?>"><?php echo $records['message']; ?></span>
            </div>
        <?php } ?>

<form action="?adcode=attendrule&action=save" method="post" id="attendanceConfig" name="attendanceConfig">
<table width="580" border="0" cellpadding="4" cellspacing="0">
	<tr>
      <td colspan="4"><h4>一般规则</h4></td>
    </tr>
    <!--tr>
      <td colspan="4">时间单位：</td>
    </tr>
    <tr>
      <td colspan="2">
        <input name="timeDanWei"  type="radio" <?php echo ($records['timeDanWei']==1?'checked':''); ?> value="1"/>（分钟）
      </td>
      <td colspan="2">
        <input name="timeDanWei"  type="radio" <?php echo ($records['timeDanWei']==2?'checked':''); ?> value="2"/>（小时）
      </td>
    </tr>
    
    
    <tr>
      <td align="right">刷卡最小间隔：</td>
      <td align="left"><input type="text" name="shuaMinTime" id="shuaMinTime" size="3"  value="<?php echo intval($records['shuaMinTime']);?>"/>（分钟）</td>
      <td align="right">工作时间计算单位：</td>
      <td align="left"><input type="text" name="workJiSuan" id="workJiSuan"   size="3"  value="<?php echo intval($records['workJiSuan']);?>"/>（分钟）</td>
    </tr-->
    
    
    <tr>
      <td align="right">上班前打卡有效时长：</td>
      <td align="left"><input type="text" name="BeforeWorkLong" id="BeforeWorkLong" size="3"  value="<?php echo intval($records['BeforeWorkLong']);?>"/>（分钟）</td>
      <td align="right">下班后打卡有效时长：</td>
      <td align="left"><input type="text" name="AfterWorkLong" id="AfterWorkLong"   size="3"  value="<?php echo intval($records['AfterWorkLong']);?>"/>（分钟）</td>
    </tr>
    
    <tr>
      <td align="right">中间休息下班打卡有效时长：</td>
      <td align="left"><input type="text" name="AfMiddleLong" id="AfMiddleLong" size="3"  value="<?php echo intval($records['AfMiddleLong']);?>"/>（分钟）</td>
      <td align="right">中间休息上班打卡有效时长：</td>
      <td align="left"><input type="text" name="StMiddleLong" id="StMiddleLong"   size="3"  value="<?php echo intval($records['StMiddleLong']);?>"/>（分钟）</td>
    </tr>
    
    
    <!--tr>
      <td colspan="4">行政白班：</td>
    </tr>
    <tr>
      <td align="right">上班时间：</td>
      <td align="left"><input type="text" name="xzDayStime" id="xzDayStime" size="3"  value="<?php echo $records['xzDayStime'];?>"/>（分钟）</td>
      <td align="right">中间下班时间：</td>
      <td align="left"><input type="text" name="xzDayMEtime" id="xzDayMEtime"   size="3"  value="<?php echo $records['xzDayMEtime'];?>"/>（分钟）</td>
    </tr>
    <tr>
      <td align="right">中间上班时间：</td>
      <td align="left"><input type="text" name="xzDayMStime" id="xzDayMStime" size="3"  value="<?php echo $records['xzDayMStime'];?>"/>（分钟）</td>
      <td align="right">下班时间：</td>
      <td align="left"><input type="text" name="xzDayEtime" id="xzDayEtime"   size="3"  value="<?php echo $records['xzDayEtime'];?>"/>（分钟）</td>
    </tr>
    
    <tr>
      <td colspan="4">行政夜班：</td>
    </tr>
    <tr>
      <td align="right">上班时间：</td>
      <td align="left"><input type="text" name="xzNightStime" id="xzNightStime" size="3"  value="<?php echo $records['xzNightStime'];?>"/>（分钟）</td>
      <td align="right">中间下班时间：</td>
      <td align="left"><input type="text" name="xzNightMEtime" id="xzNightMEtime"   size="3"  value="<?php echo $records['xzNightMEtime'];?>"/>（分钟）</td>
    </tr>
    <tr>
      <td align="right">中间上班时间：</td>
      <td align="left"><input type="text" name="xzNightMStime" id="xzNightMStime" size="3"  value="<?php echo $records['xzNightMStime'];?>"/>（分钟）</td>
      <td align="right">下班时间：</td>
      <td align="left"><input type="text" name="xzNightEtime" id="xzNightEtime"   size="3"  value="<?php echo $records['xzNightEtime'];?>"/>（分钟）</td>
    </tr-->
    
    
    <tr>
      <td>试用第1天是否免考勤</td>
      <td>
        <input name="firstDayMianQ" id="firstDayMianQ" type="checkbox" <?php echo ($records['firstDayMianQ']?'checked':''); ?> />
      </td>
      <td colspan="2"></td>
    </tr>
    
    
    <!--tr>
      <td colspan="4"><h4>考勤年度设定</h4></td>
    </tr>
    <tr>
      <td align="right">允许迟到次数：</td>
      <td align="left"><input type="text" name="LaterNum" id="LaterNum" size="3"  value="<?php echo intval($records['LaterNum']);?>"/>（次）</td>
      <td align="right">允许早退次数：</td>
      <td align="left"><input type="text" name="ZaoTuiNum" id="ZaoTuiNum"   size="3"  value="<?php echo intval($records['ZaoTuiNum']);?>"/>（次）</td>
    </tr>
    <tr>
      <td align="right">允许请假次数：</td>
      <td align="left"><input type="text" name="QingJiaNum" id="QingJiaNum" size="3"  value="<?php echo intval($records['QingJiaNum']);?>"/>（次）</td>
      <td align="right">&nbsp;</td>
      <td align="left">&nbsp;</td>
    </tr-->
    
    
    <tr>
      <td colspan="4"><h4>迟退旷规则</h4></td>
    </tr>
    
    <tr>
      <td align="right">允许迟到：</td>
      <td align="left"><input type="text" name="yunXuLate" id="yunXuLate" size="3"  value="<?php echo intval($records['yunXuLate']);?>"/>（分钟）</td>
      <td align="right">大于：</td>
      <td align="left"><input type="text" name="moreYunXuLate" id="moreYunXuLate"   size="3"  value="<?php echo intval($records['moreYunXuLate']);?>"/>（分钟）作为旷工</td>
    </tr>
    
    <tr>
      <td align="right">允许早退：</td>
      <td align="left"><input type="text" name="zaoTuiMinTime" id="zaoTuiMinTime" size="3"  value="<?php echo intval($records['zaoTuiMinTime']);?>"/>（分钟）</td>
      <td align="right">大于：</td>
      <td align="left"><input type="text" name="moreZaoTuiMinTime" id="moreZaoTuiMinTime"   size="3"  value="<?php echo intval($records['moreZaoTuiMinTime']);?>"/>（分钟）作为旷工</td>
    </tr>
  </table>


    <div class="formbuttons">
        <input type="submit" class="savebutton" id="saveBtn"
            onmouseover="moverButton(this);" onmouseout="moutButton(this);"
            value="<?php echo $lang_Common_Save;?>" />
    </div>
</form>
</div>
<script type="text/javascript">
//<![CDATA[
    if (document.getElementById && document.createElement) {
        roundBorder('outerbox');
    }
//]]>
</script>
</div>
